//
//  RootViewController.m
//  MoneyIndividual
//
//  Created by Le Anh Tai on 12/26/13.
//  Copyright (c) 2013 Le Anh Tai. All rights reserved.
//

#import "RootViewController.h"
#import "SlidingViewController.h"
#import "MenuMediator.h"

@interface RootViewController ()

@end

@implementation RootViewController

static RootViewController *_shared;

+ (RootViewController*)shared
{
    return _shared;
}

- (id)init
{
    self = [super init];
    if (self)
    {
        _shared = self;
    }
    
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view.
    
    [self addChildViewController:[MenuMediator shared].slidingController];
    [self.view addSubview:[MenuMediator shared].slidingController.view];
    
    _containerExpenseIncomeView = [[ContainerExpenseIncomeView alloc] init];
    _containerExpenseIncomeView.backgroundColor = [UIColor clearColor];
    [self.view addSubview:_containerExpenseIncomeView];
}


- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)viewWillLayoutSubviews
{
    [MenuMediator shared].slidingController.view.frame = self.view.bounds;
    
    _containerExpenseIncomeView.frame = RECT(self.view.width - SWIPE_WIDTH - DELTA_ANCHOR, 0, SWIPE_WIDTH + self.view.width, self.view.height);
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    
}

@end
